package com.atguigu.gmall.product.service.impl;
import com.atguigu.gmall.model.product.SpuPoster;
import com.atguigu.gmall.product.mapper.SpuPosterMapper;
import com.atguigu.gmall.product.service.SpuPosterService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SpuPosterServiceImpl implements SpuPosterService {

    @Autowired
    private SpuPosterMapper spuPosterMapper;

    @Override
    public List<SpuPoster> findSpuPosterBySpuId(Long spuId) {

        QueryWrapper<SpuPoster> spuPosterQueryWrapper = new QueryWrapper<>();
        spuPosterQueryWrapper.eq("spu_id",spuId);
        List<SpuPoster> spuPosters = spuPosterMapper.selectList(spuPosterQueryWrapper);

        return spuPosters;
    }
}
